package com.qianying.controller.admin;


import com.qianying.comment.CommonResult;
import com.qianying.service.ChinaAreaService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/chinaArea")
@Tag(name = "国家省市区(县信息)")
public class ChinaAreaController {
    @Autowired
    ChinaAreaService chinaAreaService;

    @GetMapping("/getArea")
    @Operation(summary = "根据id获取国家地理信息，id为空，则返回省份信息")
    public CommonResult<?> getArea(@RequestParam(required = false) Long id) {
        return chinaAreaService.getAreaByIdOrProvinces(id);
    }
}
